package com.daiziru.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.daiziru.VO.PostVO;
import com.daiziru.entity.MPost;
import com.baomidou.mybatisplus.extension.service.IService;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author wuyan
 * @since 2022-12-07
 */
public interface MPostService extends IService<MPost> {

    IPage<PostVO> selectByPage(Page page, Long categoryId, Long userId, Integer level, Boolean recommend, String order);

    PostVO selectOnePost(QueryWrapper<MPost> wrapper);

    //初始化本周热议
    void initWeekRank();
    //文章添加评论，修改缓存信息并重新计算本周文章热议评论数
    void incrCommentCountAndUnionForWeekRank(long postId, boolean isIncr);

    void putViewCount(PostVO vo);

    void zUnionAndStoreLast7DayForWeekRank();
}
